<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 剩余参数语法允许我们将一个不定数量的参数表示为一个数组
      //   function sum(a, ...args) {
      //     console.log(a);
      //     console.log(...args);
      //   }

      //   sum(1, 2, 3);
      // ...args 接收的是一个数组
      //   const sum = (...args) => {};
      let arr = ["ssss", 2, 3];
      let [s1, ...s2] = arr;
      console.log(s1, s2);
    </script>
  </body>
</html>
